<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Article extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('article', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('author_id')->comment('作者id,对应user表的id');
            $table->string('title')->comment('文章标题');
            $table->string('content')->comment('文章原内容');
            $table->string('html')->comment('文章内容html');
            $table->integer('state')->comment('文章状态，1草稿，0发布，2回收站');
            $table->string('headImg')->comment('文章开头大图');
            $table->integer('class_id')->comment('文章分类_id');
            $table->integer('collect')->comment('文章收藏数');
            $table->integer('like')->comment('文章点赞数');
            $table->integer('click')->comment('文章点击数');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('article');
    }
}
